﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LotteryVote.Utility;
using LotteryVote.Entity;
using LotteryVote.Logic;
using LotteryVote.Logic.Web;

namespace LotteryVote.Web
{
    /// <summary>
    /// UpdateBetLimit 的摘要说明
    /// </summary>
    public class UpdateBetLimit : BaseHandler
    {
        protected override SystemRole IdentityRole
        {
            get
            {
                return SystemRole.Agent;
            }
        }

        public override void Process(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string betLimitJson = context.Request["Limit"];
            IList<BetLimit> limitList = JSONHelper.ToObject<List<BetLimit>>(betLimitJson);
            BetLimitFacade blBetLimit = new BetLimitFacade();
            blBetLimit.UpdateBetLimit(limitList[0].UserId, limitList);
            context.Response.Write("Success!");
        }
    }
}